package bean.Being;


/**
 * 测试Spring使用静态工厂方法创建bean实例
 * 工厂类
 */
public class BeingFactory {
    //静态工厂方法
    public static Being getBeing(String name){
        return name.equalsIgnoreCase("dog")?new Dog():new Cat();
    }
    //实例工厂方法
    public Being getBeingByInstanceMethod(String name){
        return name.equalsIgnoreCase("dog")?new Dog():new Cat();
    }
}
